Skip to content

Support RGB colorspaces and explicit tone mapping#126

Draft
ns6089 wants to merge 2 commits intomoonlight-stream:masterfrom
ns6089:csc_ext
Draft

Support RGB colorspaces and explicit tone mapping#126
ns6089 wants to merge 2 commits intomoonlight-stream:masterfrom
ns6089:csc_ext

Conversation

@ns6089
Copy link
Contributor

@ns6089 ns6089 commented Feb 18, 2026

It's here as a placeholder for the most part, but comments are always appreciated.
There's no point in merging this in any form without adding application support at the same time,
and it will take me quite a bit of time to get to that personally.


To control bit depth and colorspace of video stream, we presently have the following tools in master:

  1. SDP x-nv-video[0].encoderCscMode >> 1
    • COLORSPACE_REC_601
    • COLORSPACE_REC_709
    • COLORSPACE_REC_2020
  2. SDP x-nv-video[0].encoderCscMode & 1
    • COLOR_RANGE_LIMITED
    • COLOR_RANGE_FULL
  3. SDP x-nv-video[0].dynamicRangeMode
    • 0
    • 1
  4. URL /launch?hdrMode=
    • 0
    • 1

Although 3 and 4 seem to be always used together by moonlight-qt.

I want to address two issues:

  1. Add support for RGB 4:4:4 encoding, which bypasses banding artifacts that stem from rounding inaccuracies in RGB->YUV->RGB conversion
  2. Support requesting tone mapped HDR->SDR 10-bit video, since this is currently impossible due to protocol ambiguity

// If not set and selected format is 10-bit, HDR content will be encoded as is.
// The reason behind this field is the ambiguity of 'supportedVideoFormats',
// as it's impossible to request 10-bit tone mapped content through that field alone.
int toneMapHDR;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure which one is better, pushing like this or pulling through renderer capabilities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant